<%--
  Created by IntelliJ IDEA.
  role: zhulingfeng
  Date: 2020/7/29
  Time: 13:56
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <base href="<%=basePath%>"/>
    <title>Title</title>
    <script src="<%=basePath%>resource/js/jquery.js"></script>
    <script src="<%=basePath%>resource/js/pintuer.js"></script>
    <script>
        $(function() {
            var array = new Array();
            <c:forEach items="${ids}" var="item" >
            array.push("${item}"); //对象，加引号
            </c:forEach>
            for (var i = 0; i < array.length; i++) {
                $("#" + array[i]).attr("checked", "checked");
            }
        })
    </script>
</head>
<body>
<div align="center">
    <h1>分配权限</h1>
</div>
分配权限角色：<font color="red">${role_db.name}</font>&nbsp;${message}
<hr>
<form action="<%=basePath%>permissionController.do?method=FPPermission" method="post">
    <input type="hidden" name="roleIdSTR" value="${role_db.roleId}">

    <c:forEach items="${permissions_db}" var="permission">
        <input type="checkbox" name="permissionIdSTR" id="${permission.permissionId }" value="${permission.permissionId}" >${permission.name}<br>
    </c:forEach>
    <p>&nbsp;</p>
    <input type="submit" value="分配权限">
</form>
</body>
</html>
